package com.Web;


import java.io.IOException;
import java.util.List;

import javax.servlet.ServletException;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import javax.servlet.http.HttpSession;

import com.service.TaskService;



public class Task extends HttpServlet {

	private static final long serialVersionUID = 1L;

	
	@Override
	protected void service(HttpServletRequest request, HttpServletResponse response)
			throws ServletException, IOException {
	
			HttpSession session = request.getSession();
			String name = request.getParameter("name");
			String desc = request.getParameter("desc"); 
			
			String id = request.getParameter("id");
		
			
			int goalid = Integer.parseInt(id);
			
			TaskService service = new TaskService();
		
			List<com.entity.Task> taskList =  service.findById(goalid);
			
			session.setAttribute("taskList", taskList);
			session.setAttribute("name", name);
			session.setAttribute("desc", desc);
			session.setAttribute("id", id);
			
			request.getRequestDispatcher("/WEB-INF/views/task.jsp").forward(request, response);
		
	}


}
